package 作业;
import java.util.Arrays;

public class ZuoYE {
    public static void main(String[] args) {
          /*
        Scanner scan = new Scanner(System.in);
        int score = 0;
        for (int a = 2; a <= 20; a++) {
            int b = (int) (Math.random() * 10);
            int c = (int) (Math.random() * 10);
            int result = b + c;
            System.out.println("(" + a + ")" + b + "+" + c + "=?");
            System.out.println("开始计算");
            int answer = scan.nextInt();
            if (answer == result) {
                System.out.println("对");
                score += 20;
            } else {
                System.out.println("错");
            }
            System.out.println("分数为：" + score);
        }

           */
           /*
          for (int num=1;num<=9;num++){
              for (int a=1;a<=num;a++){
                  System.out.print(a+"*"+num+"="+a*num+"\t");
              }
              System.out.println();
          }

            */

        int[] a = new int[5];
        for (int b=0;b<a.length;b++){
            a[b]=(int)(Math.random()*10);
            System.out.println(a[b]);
        }
            Arrays.sort(a);
        System.out.println("后:");
        for (int b=0;b<a.length;b++){
            System.out.println(a[b]);
        }
        System.out.println("倒着输出:");

    }


}